﻿namespace orleans_demo.Services
{
    // IUserGrain.cs
    public interface IUserGrain : IGrainWithStringKey
    {
        Task Create(UserDto user);
        Task Update(UserDto user);
        Task Delete();
        Task<UserDto> Get();
    }

    // UserDto.cs
    public class UserDto
    {
        public string Name { get; set; }
        public string Email { get; set; }
        public DateTime CreatedAt { get; set; }
    }



    // UserEvents.cs
    [Serializable]
    public abstract class UserEvent
    {
        public string Id { get; set; }
        public DateTime Timestamp { get; set; }
    }

    [Serializable]
    public class UserCreatedEvent : UserEvent
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
    }

    [Serializable]
    public class UserUpdatedEvent : UserEvent
    {
        public string Name { get; set; }
        public string Email { get; set; }
    }

    [Serializable]
    public class UserDeletedEvent : UserEvent { }

    // UserState.cs
    [Serializable]
    public class UserState
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
        public DateTime CreatedAt { get; set; }
        public bool IsDeleted { get; set; }
    }

    [Serializable]
    public class UserInfo
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
        public DateTime CreatedAt { get; set; }
        public bool IsDeleted { get; set; }
    }
}
